package cc.iotkit.data.model;

import cc.iotkit.common.tenant.dao.TenantAware;
import cc.iotkit.common.tenant.listener.TenantListener;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.ParamDef;

import javax.persistence.*;
import java.math.BigInteger;

@Data
@Entity
@ApiModel(value = "微自然设备群组")
@Table(name = "wzr_gw_dev_group")
@AutoMapper(target = TbWzrGwDevGroup.class)
@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "long")})
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
@EntityListeners(TenantListener.class)
public class TbWzrGwDevGroup  extends BaseEntity implements TenantAware {
    @Id
    @GeneratedValue(generator = "SnowflakeIdGenerator")
    @GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator")
    @ApiModelProperty(value = "列表id")
    private long id;
    /**
     * 所属平台用户ID
     */
    private String uid;

    private Long tenantId;
    @ApiModelProperty(value = "群组名称",required = true)
    private String gwDevGroupName;
    @ApiModelProperty(value = "工作状态,刚添加默认为关",required = true)
    private boolean workState;
    @ApiModelProperty("调光百分比")
    private int percentage;
    /**
     * 群组的虚拟mac
     */
    @ApiModelProperty("网关虚拟地址，无法提交")
    @JsonIgnore
    private int pmac = 1;
    @ApiModelProperty("设备集合，无法提交")
    @JsonIgnore
    private BigInteger pgidsum;
    @ApiModelProperty("网关id")
    private String gwid;
    @ApiModelProperty("删除群组，删除true，默认false")
    private boolean del = false;

}